﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ZhuanGuanJHXD.aspx.cs" Inherits="Web.Pages.QuShui.DiXiaS.JiHuaGL.ZhuanGuanJH.ZhuanGuanJHXD" Theme="Default"%>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

 <!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script src="../../../../../JS/jquery.js"></script>   
    <script src="../../../../../JS/AddEditCancel.js"></script>
    <script type="text/javascript">

        function XiaDaJH() {
            if (txtV.GetText() != "") {
                ASPxCallback1.PerformCallback("yz1");
            }
            else {
                alert("下达计划的年份不能为空！");
            }
        }

        function ASPxCallback1Complete(rs) {
            var arr = rs.split('|');
            var type = arr[0];
            var state = arr[1];
            if (type == "yz1") {
                if (arr[2] == "true") {
                    ASPxCallback1.PerformCallback("yz2");
                }
                else {
                    alert("该年度尚未制定计划，请先核对!");
                }
            }
            else if (type == "yz2") {
                if (arr[2] == "true") {
                    if (confirm("确认要下达专灌计划吗")) {
                        ASPxCallback1.PerformCallback("xdjh");
                    }
                }
                else {
                    alert("尚有用户未制定计划，请先核对!");
                }
            }
            else if (type == "xdjh") {
                if (arr[2] == "1") {
                    alert("计划成功下达！");
                }
                else {
                    alert("计划下达失败！");
                }
            }
        }
    </script>
</head>
<body>
     <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div class="tabletitle1" align="center">
            专灌计划下达
        </div>
         <dx:ASPxHiddenField ID="hdCollection" ClientInstanceName="hdCollection" runat="server"></dx:ASPxHiddenField>
         <dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){ASPxCallback1Complete(e.result);}"></dx:ASPxCallback>
         <dx:ASPxLoadingPanel ID="ASPxLoadingPanel1" ClientInstanceName="loadpanel1" runat="server" ContainerElementID="gvList" Modal="true" Theme="Metropolis" ShowImage="false" Text="加载中"></dx:ASPxLoadingPanel>

         <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                
                <div>
                    <table style="width: 100%;height:80px; margin-top:30px;">
                        <tr>
                            <td style="white-space: nowrap; width: 45%; text-align:right;">年份：&nbsp;&nbsp;</td>
                            <td style="white-space: nowrap; width: 45%; text-align:left;">
                                <dx:ASPxTextBox ID="txtV" Width="20%" runat="server" ClientInstanceName="txtV" ClientEnabled="false">
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap; width: 45%; text-align:center;" colspan="2">
                                <dx:ASPxButton ID="btnXiaDa" ClientInstanceName="btnXiaDa" runat="server" Text="下达" AutoPostBack="false" UseSubmitBehavior="false" >
                                    <ClientSideEvents  Click="function(s,e){XiaDaJH();}"/>
                                </dx:ASPxButton>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                            <%--<td style="white-space: nowrap; width: 45%; text-align:left;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <dx:ASPxButton ID="btnCancel" runat="server" Text="放弃" AutoPostBack="true"  OnClick="btnCancel_Click" UseSubmitBehavior="false">
                                </dx:ASPxButton>
                            </td>--%>
                        </tr>
                    </table>
                </div>
               
            </ContentTemplate>
        </asp:UpdatePanel>

    </form> 
</body>
</html> 
